#ifndef _Contorl_h
#define _Contorl_h

//障碍物最大速度
extern int BiZhang_Max_Speed;
extern int BiZhang_MinSpeed;
//环岛速度
extern int Right_Huandao_Max_Speed;
extern int Right_Huandao_Min_Speed;
extern int Left_Huandao_Max_Speed;
extern int Left_Huandao_Min_Speed;
//坡道速度
extern int Podao_Max_Speed;
extern int Podao_Min_Speed;
//弯道速度十字速度
extern int WanDao_Max_Speed;
extern int WanDao_Min_Speed;
extern int ZhiDao_Speed;
extern int Left_OUT;
extern int Right_OUT;
extern float Servo_Agle;
extern int Speed_Target;//目标速度

extern int CAR_RUN2;

void Contorl();
void Servo_Control();
int dircontrol(int chazhi);//外环
int diranglecontrol(int out_dw);//内环

float Calculate_Curvature_2(uint8 *line, uint8 start, uint8 end);
float Speed_Mapping(float sensitivity, float speed_min_proportion, float Speed_max_proportion, uint8 y_meet, uint8 min_y_meet, uint8 max_y_meet);
void Fitting_Speed_Control(uint8 Auto_Control_Flag, uint16 Manual_Control_Value, uint8 element, uint8 element_state, uint8 start, uint8 end);
extern float Last_Curvature_Value;     //防止

#endif